// pages/service/order-list-filter/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderNumber: '',
    startTime: '',
    endTime: ''
  },
  inputChange: function(e){
    var that = this;
    var val = e.detail.value;
    that.setData({
      orderNumber: val
    });
  },
  bindPickerChange: function(e){
    var that = this;
    var name = e.currentTarget.dataset.name;
    var val = e.detail.value;
    if(name == 'startTime'){
      that.setData({
        startTime: val
      });
    }else if(name == 'endTime'){
      that.setData({
        endTime: val
      });
    }
  },
  reset: function(){
    var that = this;
    that.setData({
      orderNumber: '',
      startTime: '',
      endTime: ''
    });
  },
  confirm: function(){
    var that = this;
    wx.redirectTo({
      url: '/pages/service/order-list/index?orderNumber=' + that.data.orderNumber + '&startTime=' + that.data.startTime + '&endTime=' + that.data.endTime
    });
  }
})